<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>group | epg-focus-vue</title>
    <meta name="description" content="主要应用于电视端焦点交互">
    <meta name="generator" content="VuePress 1.4.0">
    <meta name="theme-color" content="#3eaf7c">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
    
    <link rel="preload" href="/epg-focus/assets/css/0.styles.33941019.css" as="style"><link rel="preload" href="/epg-focus/assets/js/app.b31e66c6.js" as="script"><link rel="preload" href="/epg-focus/assets/js/2.20e6004e.js" as="script"><link rel="preload" href="/epg-focus/assets/js/18.ae87f8b0.js" as="script"><link rel="prefetch" href="/epg-focus/assets/js/10.2514fb4c.js"><link rel="prefetch" href="/epg-focus/assets/js/11.793ea926.js"><link rel="prefetch" href="/epg-focus/assets/js/12.01e4e231.js"><link rel="prefetch" href="/epg-focus/assets/js/13.1423ccd0.js"><link rel="prefetch" href="/epg-focus/assets/js/14.115308bc.js"><link rel="prefetch" href="/epg-focus/assets/js/15.8399aeea.js"><link rel="prefetch" href="/epg-focus/assets/js/16.bd815638.js"><link rel="prefetch" href="/epg-focus/assets/js/17.dd77a29f.js"><link rel="prefetch" href="/epg-focus/assets/js/19.c6e425a9.js"><link rel="prefetch" href="/epg-focus/assets/js/20.5dd0cf52.js"><link rel="prefetch" href="/epg-focus/assets/js/21.b87d0d78.js"><link rel="prefetch" href="/epg-focus/assets/js/22.5709ae7e.js"><link rel="prefetch" href="/epg-focus/assets/js/23.1c381a02.js"><link rel="prefetch" href="/epg-focus/assets/js/24.a133fc1f.js"><link rel="prefetch" href="/epg-focus/assets/js/25.d262c8d0.js"><link rel="prefetch" href="/epg-focus/assets/js/26.825a6650.js"><link rel="prefetch" href="/epg-focus/assets/js/27.57eb15d3.js"><link rel="prefetch" href="/epg-focus/assets/js/28.5b056900.js"><link rel="prefetch" href="/epg-focus/assets/js/3.7cc2bdd4.js"><link rel="prefetch" href="/epg-focus/assets/js/4.82f74d64.js"><link rel="prefetch" href="/epg-focus/assets/js/5.fe38ea94.js"><link rel="prefetch" href="/epg-focus/assets/js/6.0d7ca19c.js"><link rel="prefetch" href="/epg-focus/assets/js/7.4478646a.js"><link rel="prefetch" href="/epg-focus/assets/js/8.0d360ba2.js"><link rel="prefetch" href="/epg-focus/assets/js/9.40007ddf.js">
    <link rel="stylesheet" href="/epg-focus/assets/css/0.styles.33941019.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/epg-focus/" class="home-link router-link-active"><!----> <span class="site-name">epg-focus-vue</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/epg-focus/guide/" class="nav-link">
  引导
</a></div><div class="nav-item"><a href="/epg-focus/v1/" class="nav-link">
  v1
</a></div><div class="nav-item"><a href="/epg-focus/v2/" class="nav-link router-link-active">
  v2
</a></div><div class="nav-item"><a href="/epg-focus/v3/" class="nav-link">
  v3
</a></div><div class="nav-item"><a href="https://gitee.com/wyzhgx/focus-vue" target="_blank" rel="noopener noreferrer" class="nav-link external">
  gitee
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><a href="https://www.npmjs.com/package/epg-focus-vue" target="_blank" rel="noopener noreferrer" class="nav-link external">
  npm
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/epg-focus/guide/" class="nav-link">
  引导
</a></div><div class="nav-item"><a href="/epg-focus/v1/" class="nav-link">
  v1
</a></div><div class="nav-item"><a href="/epg-focus/v2/" class="nav-link router-link-active">
  v2
</a></div><div class="nav-item"><a href="/epg-focus/v3/" class="nav-link">
  v3
</a></div><div class="nav-item"><a href="https://gitee.com/wyzhgx/focus-vue" target="_blank" rel="noopener noreferrer" class="nav-link external">
  gitee
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><a href="https://www.npmjs.com/package/epg-focus-vue" target="_blank" rel="noopener noreferrer" class="nav-link external">
  npm
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>v2.x开发文档</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/epg-focus/v2/" class="sidebar-link">全局配置</a></li><li><a href="/epg-focus/v2/api.html" class="sidebar-link">全局 API</a></li><li><a href="/epg-focus/v2/event.html" class="sidebar-link">按键事件</a></li><li><a href="/epg-focus/v2/long-event.html" class="sidebar-link">按键长按事件</a></li><li><a href="/epg-focus/v2/items.html" class="sidebar-link">items</a></li><li><a href="/epg-focus/v2/group.html" class="active sidebar-link">group</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/epg-focus/v2/group.html#简介" class="sidebar-link">简介</a></li><li class="sidebar-sub-header"><a href="/epg-focus/v2/group.html#属性" class="sidebar-link">属性</a></li><li class="sidebar-sub-header"><a href="/epg-focus/v2/group.html#示例" class="sidebar-link">示例</a></li></ul></li><li><a href="/epg-focus/v2/keep-alive.html" class="sidebar-link">keepAlive 应用方案</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="group"><a href="#group" class="header-anchor">#</a> group</h1> <h2 id="简介"><a href="#简介" class="header-anchor">#</a> 简介</h2> <p>对应焦点注册的 <code>group</code> 标记；用于划分部分焦点所属区域</p> <h2 id="属性"><a href="#属性" class="header-anchor">#</a> 属性</h2> <table><thead><tr><th>名称</th> <th>描述</th> <th>类型</th> <th>必要性</th></tr></thead> <tbody><tr><td>data-sign</td> <td>区域名称标记（对应区域内部节点的<code>data-group</code>属性，且同一<code>routeview</code>中具有唯一性）</td> <td>String</td> <td>Y</td></tr> <tr><td>data-group</td> <td>所属区域标记（对应父group区域的<code>data-sign</code>属性；默认为''）</td> <td>String</td> <td>N</td></tr> <tr><td>data-popup</td> <td>所属弹层标记</td> <td>String</td> <td>N</td></tr></tbody></table> <div class="custom-block warning"><p class="custom-block-title">注意</p> <p>如果<code>data-group</code>有值，且指向的 group 未被注册；那么对应该<code>group</code>的所有 group 区域在移动计算时将被忽略</p></div> <h2 id="示例"><a href="#示例" class="header-anchor">#</a> 示例</h2> <div class="language-vue extra-class"><pre class="language-vue"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>template</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>vertical<span class="token punctuation">&quot;</span></span> <span class="token attr-name">v-group</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>outer<span class="token punctuation">&quot;</span></span> <span class="token attr-name">:data-sign</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>outer<span class="token punctuation">&quot;</span></span> <span class="token attr-name">:data-popup</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>popup<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span>
      <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>vertical-items<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">v-items</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>info<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">@vFocus</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>focus<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">@vLostFocus</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>lostFocus<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:data-group</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>outer<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:data-popup</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>popup<span class="token punctuation">&quot;</span></span>
    <span class="token punctuation">&gt;</span></span>
      {{ info.msg }}
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span>
      <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>vertical<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">v-group</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>inner<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:data-sign</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>inner<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:data-group</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>outer<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:data-popup</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>popup<span class="token punctuation">&quot;</span></span>
    <span class="token punctuation">&gt;</span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span>
        <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>vertical-items<span class="token punctuation">&quot;</span></span>
        <span class="token attr-name">v-items</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>innerInfo<span class="token punctuation">&quot;</span></span>
        <span class="token attr-name">@vFocus</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>focus<span class="token punctuation">&quot;</span></span>
        <span class="token attr-name">@vLostFocus</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>lostFocus<span class="token punctuation">&quot;</span></span>
        <span class="token attr-name">:data-group</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>inner<span class="token punctuation">&quot;</span></span>
        <span class="token attr-name">:data-popup</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>popup<span class="token punctuation">&quot;</span></span>
      <span class="token punctuation">&gt;</span></span>
        {{ innerInfo.msg }}
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>template</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span><span class="token punctuation">&gt;</span></span><span class="token script"><span class="token language-javascript">
  <span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
    <span class="token function">data</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">return</span> <span class="token punctuation">{</span>
        info<span class="token operator">:</span> <span class="token punctuation">{</span>
          msg<span class="token operator">:</span> <span class="token string">&quot;outer示例文本&quot;</span><span class="token punctuation">,</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        innerInfo<span class="token operator">:</span> <span class="token punctuation">{</span>
          msg<span class="token operator">:</span> <span class="token string">&quot;inner实例文本&quot;</span><span class="token punctuation">,</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        outer<span class="token operator">:</span> <span class="token string">&quot;outer&quot;</span><span class="token punctuation">,</span>
        inner<span class="token operator">:</span> <span class="token string">&quot;inner&quot;</span><span class="token punctuation">,</span>
        popup<span class="token operator">:</span> <span class="token string">&quot;warning&quot;</span><span class="token punctuation">,</span>
      <span class="token punctuation">}</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token punctuation">}</span><span class="token punctuation">;</span>
</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">&gt;</span></span>
</code></pre></div></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/epg-focus/v2/items.html" class="prev">
        items
      </a></span> <span class="next"><a href="/epg-focus/v2/keep-alive.html">
        keepAlive 应用方案
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"><!----></div></div>
    <script src="/epg-focus/assets/js/app.b31e66c6.js" defer></script><script src="/epg-focus/assets/js/2.20e6004e.js" defer></script><script src="/epg-focus/assets/js/18.ae87f8b0.js" defer></script>
  </body>
</html>
